/* *****************************************************************************************************







    Umbraco database installation script for Oracle 
 
IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
 
    Database version: 4.0.0.0
    
    Please increment this version number if ANY change is made to this script,
    so compatibility with scripts for other database systems can be verified easily.
    The first 3 digits depict the Umbraco version, the last digit is the database version.
    (e.g. version 4.0.0.3 means "Umbraco version 4.0.0, database version 3")
    
    Check-in policy: only commit this script if
     * you ran the Umbraco installer completely;
     * you ran it on the targetted database system;
     * you ran the Boost and Nitro installation;
     * you were able to browse the Boost site;
     * you were able to open the Umbraco administration panel;
     * you have documented the code change in this script;
     * you have incremented the version number in this script.
     
    by Rony Degen
 
IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT







** ****************************************************************************************************/
/* umbracoRelation ************************************************************************************/
CREATE TABLE "umbracoRelation"
      (
         "id"       NUMBER NOT NULL                     ,
         "parentId" NUMBER NOT NULL                     ,
         "childId"  NUMBER NOT NULL                     ,
         "relType"  NUMBER NOT NULL                     ,
         "datetime" TIMESTAMP DEFAULT SYSDATE NOT NULL ENABLE,
         "comment" VARCHAR2 ( 1000 CHAR ) NOT NULL      ,
         CONSTRAINT "umbracoRelation_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoRelation_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoRelation_TRG" BEFORE
    INSERT ON "umbracoRelation" FOR EACH ROW BEGIN
    SELECT "umbracoRelation_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsDocument ****************************************************************************************/
CREATE TABLE "cmsDocument"
      (
         "nodeId"       NUMBER NOT NULL                 ,
         "published"    NUMBER ( 1, 0 ) NOT NULL        ,
         "documentUser" NUMBER NOT NULL                 ,
         "versionId"    VARCHAR2 ( 36 CHAR ) NOT NULL   ,
         "text"         VARCHAR2 ( 255 CHAR ) NOT NULL  ,
         "releaseDate" DATE                             ,
         "expireDate" DATE                              ,
         "updateDate" TIMESTAMP DEFAULT SYSDATE              ,
         "templateId" NUMBER                            ,
         "alias"      VARCHAR2 ( 255 CHAR )             ,
         "newest"     NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         CONSTRAINT "cmsDocument_PK" PRIMARY KEY ( "versionId" ) ENABLE
      ) ;
/
CREATE OR REPLACE TRIGGER "cmsDocument_TRG" BEFORE
    UPDATE ON "cmsDocument" FOR EACH ROW BEGIN
    SELECT SYSDATE INTO :NEW."updateDate" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoLog *****************************************************************************************/
CREATE TABLE "umbracoLog"
      (
         "id"     NUMBER NOT NULL                        ,
         "userId" NUMBER NOT NULL                        ,
         "NodeId" NUMBER NOT NULL                        ,
         "Datestamp" TIMESTAMP DEFAULT SYSDATE NOT NULL ENABLE,
         "logHeader"  VARCHAR2 ( 255 CHAR ) NOT NULL      ,
         "logComment" VARCHAR2 ( 4000 CHAR )              ,
         CONSTRAINT "umbracoLog_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoLog_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoLog_TRG" BEFORE
    INSERT ON "umbracoLog" FOR EACH ROW BEGIN
    SELECT "umbracoLog_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoUserGroup ***********************************************************************************/
CREATE TABLE "umbracoUserGroup"
      (
         "id"            NUMBER NOT NULL               ,
         "userGroupName" VARCHAR2 ( 255 CHAR ) NOT NULL,
         CONSTRAINT "umbracoUserGroup_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoUserGroup_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoUserGroup_TRG" BEFORE
    INSERT ON "umbracoUserGroup" FOR EACH ROW BEGIN
    SELECT "umbracoUserGroup_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoUser2userGroup ******************************************************************************/
CREATE TABLE "umbracoUser2userGroup"
      (
         "user"      NUMBER NOT NULL,
         "userGroup" NUMBER NOT NULL
      ) ;
/
ALTER TABLE "umbracoUser2userGroup" ADD CONSTRAINT "PK_user2userGroup" PRIMARY KEY
			(
			   "user", "userGroup"
			)
			ENABLE ;
/			
/* ****************************************************************************************************/
/* umbracoApp *****************************************************************************************/
CREATE TABLE "umbracoApp"
      (
         "sortOrder"            NUMBER DEFAULT 0 NOT NULL     ,
         "appAlias"             VARCHAR2 ( 50 CHAR ) NOT NULL ,
         "appIcon"              VARCHAR2 ( 255 CHAR ) NOT NULL,
         "appName"              VARCHAR2 ( 255 CHAR ) NOT NULL,
         "appInitWithTreeAlias" VARCHAR2 ( 255 CHAR )         ,
         CONSTRAINT "umbracoApp_PK" PRIMARY KEY ( "appAlias" ) ENABLE
      ) ;
/
/* ****************************************************************************************************/
/* cmsPropertyData ************************************************************************************/
CREATE TABLE "cmsPropertyData"
      (
         "id"             NUMBER NOT NULL     ,
         "contentNodeId"  NUMBER NOT NULL     ,
         "versionId"      VARCHAR2 ( 36 CHAR ),
         "propertyTypeId" NUMBER NOT NULL     ,
         "dataInt"        NUMBER              ,
         "dataDate" DATE                      ,
         "dataNvarchar" VARCHAR2 ( 500 CHAR ) ,
         "dataNtext" CLOB                     ,
         CONSTRAINT "cmsPropertyData_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsPropertyData_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsPropertyData_TRG" BEFORE
    INSERT ON "cmsPropertyData" FOR EACH ROW BEGIN
    SELECT "cmsPropertyData_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/    
CREATE INDEX "IX_cmsPropertyData_1" ON "cmsPropertyData"
      ( "contentNodeId"
      ) ;
/
CREATE INDEX "IX_cmsPropertyData_2" ON "cmsPropertyData"
      ( "versionId"
      ) ;
/
CREATE INDEX "IX_cmsPropertyData_3" ON "cmsPropertyData"
      ( "propertyTypeId"
      ) ;
/   
/* ****************************************************************************************************/
/* cmsContent *****************************************************************************************/
CREATE TABLE "cmsContent"
      (
         "pk"          NUMBER NOT NULL,
         "nodeId"      NUMBER NOT NULL,
         "contentType" NUMBER NOT NULL,
         CONSTRAINT "cmsContent_PK" PRIMARY KEY ( "pk" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsContent_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsContent_TRG" BEFORE
    INSERT ON "cmsContent" FOR EACH ROW BEGIN
    SELECT "cmsContent_SEQ".NEXTVAL INTO :NEW."pk" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsContentType *************************************************************************************/
CREATE TABLE "cmsContentType"
      (
         "pk"     NUMBER NOT NULL      ,
         "NodeId" NUMBER NOT NULL      ,
         "alias"  VARCHAR2 ( 255 CHAR ),
         "icon"   VARCHAR2 ( 255 CHAR ),
         CONSTRAINT "cmsContentType_PK" PRIMARY KEY ( "pk" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsContentType_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsContentType_TRG" BEFORE
    INSERT ON "cmsContentType" FOR EACH ROW BEGIN
    SELECT "cmsContentType_SEQ".NEXTVAL INTO :NEW."pk" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsMacroPropertyType *******************************************************************************/
/* Column macroPropertyTypeRendAssembly shortened by 2 chars ******************************************/
CREATE TABLE "cmsMacroPropertyType"
      (
         "id"                              NUMBER NOT NULL      ,
         "macroPropertyTypeAlias"          VARCHAR2 ( 50 CHAR ) ,
         "macroPropertyTypeRendAssembly"   VARCHAR2 ( 255 CHAR ),
         "macroPropertyTypeRenderType"     VARCHAR2 ( 255 CHAR ),
         "macroPropertyTypeBaseType"       VARCHAR2 ( 255 CHAR ),
         CONSTRAINT "cmsMacroPropertyType_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsMacroPropertyType_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsMacroPropertyType_TRG" BEFORE
    INSERT ON "cmsMacroPropertyType" FOR EACH ROW BEGIN
    SELECT "cmsMacroPropertyType_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoStylesheetProperty **************************************************************************/
CREATE TABLE "umbracoStylesheetProperty"
      (
         "id"                       NUMBER NOT NULL                   ,
         "stylesheetPropertyEditor" NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "stylesheet"               NUMBER NOT NULL                   ,
         stylesheetPropertyAlias    VARCHAR2 ( 50 CHAR )              ,
         stylesheetPropertyName     VARCHAR2 ( 255 CHAR )             ,
         stylesheetPropertyValue    VARCHAR2 ( 400 CHAR )             ,
         CONSTRAINT "umbracoStylesheetProperty_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoStylesheetProperty_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoStylesheetProperty_TRG" BEFORE
    INSERT ON "umbracoStylesheetProperty" FOR EACH ROW BEGIN
    SELECT "umbracoStylesheetProperty_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsTab *********************************************************************************************/
CREATE TABLE "cmsTab"
      (
         "id"                NUMBER NOT NULL               ,
         "contenttypeNodeId" NUMBER NOT NULL               ,
         "text"              VARCHAR2 ( 255 CHAR ) NOT NULL,
         "sortorder"         NUMBER NOT NULL               ,
         CONSTRAINT "cmsTab_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsTab_SEQ" MINVALUE 10000 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 10000 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsTab_TRG" BEFORE
    INSERT ON "cmsTab" FOR EACH ROW BEGIN
    IF :NEW."id" IS NULL THEN	
    	SELECT "cmsTab_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
    END IF;
END;
/  
/* ****************************************************************************************************/
/* cmsTemplate ****************************************************************************************/
CREATE TABLE "cmsTemplate"
      (
         "pk"     NUMBER NOT NULL           ,
         "nodeId" NUMBER NOT NULL           ,
         "master" NUMBER NULL               ,
         "alias"  VARCHAR2 ( 100 CHAR ) NULL,
         "design" CLOB NOT NULL             ,
         CONSTRAINT "cmsTemplate_PK" PRIMARY KEY ( "pk" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsTemplate_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsTemplate_TRG" BEFORE
    INSERT ON "cmsTemplate" FOR EACH ROW BEGIN
    SELECT "cmsTemplate_SEQ".NEXTVAL INTO :NEW."pk" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoUser2app ************************************************************************************/
CREATE TABLE "umbracoUser2app"
      (
         "user" NUMBER NOT NULL,
         "app"  VARCHAR2 ( 50 CHAR ) NOT NULL
      ) ;
/
ALTER TABLE "umbracoUser2app" ADD CONSTRAINT "PK_user2app" PRIMARY KEY
			(
			   "user", "app"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* umbracoUserType ************************************************************************************/
CREATE TABLE "umbracoUserType"
      (
         "id"                         NUMBER NOT NULL               ,
         "userTypeAlias"              VARCHAR2 ( 50 CHAR )          ,
         "userTypeName"               VARCHAR2 ( 255 CHAR ) NOT NULL,
         "userTypeDefaultPermissions" VARCHAR2 ( 50 CHAR )          ,
         CONSTRAINT "umbracoUserType_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoUserType_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoUserType_TRG" BEFORE
    INSERT ON "umbracoUserType" FOR EACH ROW BEGIN
    SELECT "umbracoUserType_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoUser ****************************************************************************************/
CREATE TABLE "umbracoUser"
      (
         "id"                     NUMBER NOT NULL                   ,
         "userDisabled"           NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "userNoConsole"          NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "userType"               NUMBER NOT NULL                   ,
         "startStructureID"       NUMBER NOT NULL                   ,
         "startMediaID"           NUMBER                            ,
         "userName"               VARCHAR2 ( 255 CHAR ) NOT NULL         ,
         "userLogin"              VARCHAR2 ( 125 CHAR ) NOT NULL         ,
         "userPassword"           VARCHAR2 ( 125 CHAR ) NOT NULL         ,
         "userEmail"              VARCHAR2 ( 255 CHAR ) NOT NULL         ,
         "userDefaultPermissions" VARCHAR2 ( 50 CHAR )                   ,
         "userLanguage"           VARCHAR2 ( 10 CHAR )                   ,
         "defaultToLiveEditing"   NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         CONSTRAINT "umbracoUser_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoUser_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoUser_TRG" BEFORE
    INSERT ON "umbracoUser" FOR EACH ROW BEGIN
    SELECT "umbracoUser_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsDocumentType ************************************************************************************/
CREATE TABLE "cmsDocumentType"
      (
         "contentTypeNodeId" NUMBER NOT NULL,
         "templateNodeId"    NUMBER NOT NULL,
         "isDefault"         NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL
      ) ;
/
ALTER TABLE "cmsDocumentType" ADD CONSTRAINT "PK_cmsDocumentType" PRIMARY KEY
			(
			   "contentTypeNodeId", "templateNodeId"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* cmsMemberType **************************************************************************************/
 CREATE TABLE "cmsMemberType"
      (
         "pk"             NUMBER NOT NULL                   ,
         "NodeId"         NUMBER NOT NULL                   ,
         "propertytypeId" NUMBER NOT NULL                   ,
         "memberCanEdit"  NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "viewOnProfile"  NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         CONSTRAINT "cmsMemberType_PK" PRIMARY KEY ( "pk" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsMemberType_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 10 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsMemberType_TRG" BEFORE
    INSERT ON "cmsMemberType" FOR EACH ROW BEGIN
    SELECT "cmsMemberType_SEQ".NEXTVAL INTO :NEW."pk" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoStatSession *********************************************************************************/
 CREATE TABLE "umbracoStatSession"
      (
         "id"            NUMBER NOT NULL               ,
         "MemberId"      VARCHAR2 ( 36 CHAR )          ,
         "NewsletterId"  NUMBER                        ,
         "ReturningUser" NUMBER ( 1, 0 ) NOT NULL      ,
         "SessionStart" DATE NOT NULL                  ,
         "SessionEnd" DATE                             ,
         "Language"        VARCHAR2 ( 20 CHAR ) NOT NULL      ,
         "UserAgent"       VARCHAR2 ( 255 CHAR ) NOT NULL     ,
         "Browser"         VARCHAR2 ( 255 CHAR ) NOT NULL     ,
         "BrowserVersion"  VARCHAR2 ( 20 CHAR ) NOT NULL      ,
         "OperatingSystem" VARCHAR2 ( 50 CHAR ) NOT NULL      ,
         "Ip"              VARCHAR2 ( 50 CHAR ) NOT NULL      ,
         "Referrer"        VARCHAR2 ( 255 CHAR ) NOT NULL     ,
         "ReferrerKeyword" VARCHAR2 ( 255 CHAR ) NOT NULL     ,
         "allowCookies"    NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL ,
         "visitorId"       VARCHAR2 ( 36 CHAR )               ,
         "browserType"     VARCHAR2 ( 255 CHAR )              ,
         "isHuman"         NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL ,
         CONSTRAINT "umbracoStatSession_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoStatSession_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoStatSession_TRG" BEFORE
    INSERT ON "umbracoStatSession" FOR EACH ROW BEGIN
    SELECT "umbracoStatSession_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoNode ****************************************************************************************/
CREATE TABLE "umbracoNode"
      (
         "id"             NUMBER NOT NULL                   		,
         "trashed"        NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL		,
         "parentID"       NUMBER NOT NULL                 		  ,
         "nodeUser"       NUMBER                          		  ,
         "level"          NUMBER NOT NULL                 		  ,
         "path"           VARCHAR2 ( 150 CHAR ) NOT NULL  		  ,
         "sortOrder"      NUMBER NOT NULL                 		  ,
         "uniqueID"       VARCHAR2 ( 36 CHAR )            		  ,
         "text"           VARCHAR2 ( 255 CHAR )         		    ,
         "nodeObjectType" VARCHAR2 ( 36 CHAR )                 		  ,
         "createDate" TIMESTAMP DEFAULT SYSDATE NOT NULL ENABLE ,
         CONSTRAINT "umbracoNode_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoNode_SEQ" MINVALUE 10000 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 10000 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoNode_TRG" BEFORE
    INSERT ON "umbracoNode" FOR EACH ROW BEGIN
    IF :NEW."id" IS NULL THEN
    	SELECT "umbracoNode_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
  	END IF;
END;
/    
CREATE INDEX "IX_umbracoNodeParentId" ON "umbracoNode"
      ( "parentID"
      ) ;
/
CREATE INDEX "IX_umbracoNodeObjectType" ON "umbracoNode"
      ( "nodeObjectType"
      ) ;
/
/* ****************************************************************************************************/
/* cmsPropertyType ************************************************************************************/
CREATE TABLE "cmsPropertyType"
      (
         "id"               NUMBER NOT NULL                   ,
         "dataTypeId"       NUMBER NOT NULL                   ,
         "contentTypeId"    NUMBER NOT NULL                   ,
         "tabId"            NUMBER NULL                       ,
         "Alias"            VARCHAR2 ( 255 CHAR ) NOT NULL    ,
         "Name"             VARCHAR2 ( 255 CHAR ) NULL        ,
         "helpText"         VARCHAR2 ( 1000 CHAR ) NULL       ,
         "sortOrder"        NUMBER DEFAULT 0 NOT NULL         ,
         "mandatory"        NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "validationRegExp" VARCHAR2 ( 255 CHAR ) NULL        ,
         "Description"      VARCHAR2 ( 2000 CHAR ) NULL       ,
         CONSTRAINT "cmsPropertyType_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsPropertyType_SEQ" MINVALUE 10000 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 10000 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsPropertyType_TRG" BEFORE
    INSERT ON "cmsPropertyType" FOR EACH ROW BEGIN
    IF :NEW."id" IS NULL THEN
    	SELECT "cmsPropertyType_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
    END IF;
END;
/
/* ****************************************************************************************************/
/* umbracoContentData *********************************************************************************/
CREATE VIEW "umbracoContentData" AS
 SELECT "versionId"                                                                           							  AS "versionId",
      cmstype."Alias"                                                                        								  AS "alias"    ,
      COALESCE ( CAST(DBMS_LOB.SUBSTR("dataNtext", 4000,1) AS VARCHAR2(4000 CHAR)) , TO_CHAR ("dataNvarchar"), TO_CHAR ( "dataDate" ), TO_CHAR ( "dataInt" ) ) AS "content"
      FROM "cmsPropertyData" cmsdata,
      "cmsPropertyType" cmstype
     WHERE cmstype."id" = cmsdata."propertyTypeId" ;
/
/* ****************************************************************************************************/
/* umbracoContent *************************************************************************************/
CREATE VIEW "umbracoContent" AS
 SELECT node."id"    AS "nodeID"                                            ,
      cd."versionId" AS "versionID"                                         ,
      cd."published" AS "show"                                              ,
      node."parentID"                                                       ,
      node."nodeUser"                                                       ,
      node."level"                                                          ,
      node."sortOrder"                                                      ,
      cc."contentType"                                                      ,
      COALESCE ( cd."templateId", dct."templateNodeId" ) AS "templateNodeId",
      cd."documentUser"                                                     ,
      1                 AS "language"                                                       ,
      node."createDate" AS "createdate"                                                     ,
      cd."updateDate"                                                                       ,
      cd."releaseDate"                                                                      ,
      cd."expireDate"                                                                       ,
      node."path"                                                                           ,
      cd."text"              AS "nodeName"                                                               ,
      lower ( cd."text" )    AS "urlName"                                                                ,
      versionUser."userName" AS "versionUserName"                                                        ,
      nodeUser."userName"    AS "nodeUserName"                                                           ,
      ct."alias"                                                                                         ,
      ctNode."text" AS "nodeTypeName"
      FROM "umbracoNode" node,
      "cmsContent" cc        ,
      "cmsDocument" cd       ,
      "cmsContentType" ct    ,
      "umbracoNode" ctNode   ,
      "cmsDocumentType" dct  ,
      "umbracoUser" nodeUser ,
      "umbracoUser" versionUser
     WHERE cc."nodeId"            = node."id"
      AND cd."nodeId"             = node."id"
      AND "published"             = 1
      AND ct."NodeId"             = cc."contentType"
      AND ctNode."id"             = ct."NodeId"
      AND dct."contentTypeNodeId" = ct."NodeId"(+)
      AND dct."isDefault"         = 1
      AND nodeUser."id"           = node."nodeUser"(+)
      AND versionUser."id"        = cd."documentUser"(+)
      AND node."nodeObjectType"   = 'C66BA18E-EAF3-4CFF-8A22-41B16D66A972'
      AND node."parentID"        != - 10;
/
/* ****************************************************************************************************/
/* cmsMacroProperty ***********************************************************************************/
CREATE TABLE "cmsMacroProperty"
      (
         "id"                     NUMBER NOT NULL                   ,
         "macroPropertyHidden"    NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "macroPropertyType"      NUMBER NOT NULL                   ,
         "macro"                  NUMBER NOT NULL                   ,
         "macroPropertySortOrder" NUMBER DEFAULT 0 NOT NULL         ,
         "macroPropertyAlias"     VARCHAR2 ( 50 CHAR ) NOT NULL     ,
         "macroPropertyName"      VARCHAR2 ( 255 CHAR ) NOT NULL    ,
         CONSTRAINT "cmsMacroProperty" PRIMARY KEY ( "id" ) ENABLE
      ) ;
CREATE SEQUENCE "cmsMacroProperty_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsMacroProperty_TRG" BEFORE
    INSERT ON "cmsMacroProperty" FOR EACH ROW BEGIN
    SELECT "cmsMacroProperty_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsMacro *******************************************************************************************/
CREATE TABLE "cmsMacro"
      (
         "id"                     NUMBER NOT NULL                   ,
         "macroUseInEditor"       NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "macroRefreshRate"       NUMBER  DEFAULT 0 NOT NULL        ,
         "macroAlias"             VARCHAR2 ( 50 CHAR ) NOT NULL          ,
         "macroName"              VARCHAR2 ( 255 CHAR ) NULL             ,
         "macroScriptType"        VARCHAR2 ( 255 CHAR ) NULL             ,
         "macroScriptAssembly"    VARCHAR2 ( 255 CHAR ) NULL             ,
         "macroXSLT"              VARCHAR2 ( 255 CHAR ) NULL             ,
         "macroCacheByPage"       NUMBER ( 1, 0 ) DEFAULT 1 NOT NULL,
         "macroCachePersonalized" NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "macroDontRender"        NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         CONSTRAINT "cmsMacro" PRIMARY KEY ( "id" ) ENABLE
      ) ;
CREATE SEQUENCE "cmsMacro_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsMacro_TRG" BEFORE
    INSERT ON "cmsMacro" FOR EACH ROW BEGIN
    SELECT "cmsMacro_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsContentVersion **********************************************************************************/
CREATE TABLE "cmsContentVersion"
      (
         "id"        NUMBER NOT NULL 							 ,
         "ContentId" NUMBER NOT NULL               ,
         "VersionId" VARCHAR2 ( 36 CHAR ) NOT NULL ,
         "VersionDate" TIMESTAMP DEFAULT SYSDATE   ,
         CONSTRAINT "cmsContentVersion" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsContentVersion_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsContentVersion_TRG" BEFORE
    INSERT ON "cmsContentVersion" FOR EACH ROW BEGIN
    SELECT "cmsContentVersion_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoAppTree *************************************************************************************/
 CREATE TABLE "umbracoAppTree"
      (
         "treeSilent"          NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "treeInitialize"      NUMBER ( 1, 0 ) DEFAULT 1 NOT NULL,
         "treeSortOrder"       NUMBER NOT NULL                   ,
         "appAlias"            VARCHAR2 ( 50 CHAR ) NOT NULL     ,
         "treeAlias"           VARCHAR2 ( 150 CHAR ) NOT NULL    ,
         "treeTitle"           VARCHAR2 ( 255 CHAR ) NOT NULL    ,
         "treeIconClosed"      VARCHAR2 ( 255 CHAR ) NOT NULL    ,
         "treeIconOpen"        VARCHAR2 ( 255 CHAR ) NOT NULL    ,
         "treeHandlerAssembly" VARCHAR2 ( 255 CHAR ) NOT NULL    ,
         "treeHandlerType"     VARCHAR2 ( 255 CHAR ) NOT NULL    ,
         "action"              VARCHAR2 ( 300 CHAR )
      ) ;
/
ALTER TABLE "umbracoAppTree" ADD CONSTRAINT "PK_umbracoAppTree" PRIMARY KEY
			(
			   "appAlias", "treeAlias"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* cmsContentTypes ************************************************************************************/
CREATE VIEW "cmsContentTypes" AS
 SELECT    *
      FROM "umbracoNode" node,
      "cmsContentType" ct    ,
      "cmsDocumentType" dct
     WHERE ct."NodeId"            = node."id"
      AND dct."contentTypeNodeId" = ct."NodeId"(+);
/
/* ****************************************************************************************************/
/* cmsContentTypes ************************************************************************************/
CREATE VIEW "umbracoContentAll" AS
 SELECT    node."id" AS "nodeID"   ,
      cv."VersionId" AS "versionID",
      0              AS "show"     ,
      node."parentID"              ,
      node."nodeUser"              ,
      node."level"                 ,
      node."sortOrder"             ,
      cc."contentType"             ,
      - 1               AS "templateNodeId"      ,
      NULL              AS "documentUser"        ,
      1                 AS "language"            ,
      node."createDate" AS "createdate"          ,
      NULL              AS "releaseDate"         ,
      NULL              AS "expireDate"          ,
      NULL              AS "updateDate"          ,
      node."path"                                ,
      node."text"                                AS "nodeName"                  ,
      lower ( REPLACE ( node."text", ' ', '' ) ) AS "urlName"                   ,
      NULL                                       AS "documentUserName"          ,
      nodeUser."userName"                        AS "nodeUserName"              ,
      ct."alias"                                                                ,
      ctNode."text" AS "nodeTypeName"
      FROM "umbracoNode" node,
      "cmsContent" cc        ,
      "cmsContentVersion" cv ,
      "cmsContentType" ct    ,
      "umbracoNode" ctNode   ,
      "umbracoUser" nodeUser
     WHERE cc."nodeId"   = node."id"
      AND cv."ContentId" = cc."nodeId"
      AND ct."NodeId"    = cc."contentType"
      AND ctNode."id"    = ct."NodeId"
      AND nodeUser."id"  = node."nodeUser"(+) ;
/* ****************************************************************************************************/
/* cmsContTypeAllowedContType *************************************************************************/
/* shorted by 6 chars; oracle allows no object names with more than 30 chars **************************/
CREATE TABLE "cmsContTypeAllowedContType"
      (
         "Id"        NUMBER NOT NULL,
         "AllowedId" NUMBER NOT NULL
      ) ;
/
ALTER TABLE "cmsContTypeAllowedContType" ADD CONSTRAINT "PK_cmsContTypeAllowedContType" PRIMARY KEY
			(
			   "Id", "AllowedId"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* cmsContentXml **************************************************************************************/
 CREATE TABLE "cmsContentXml"
      (
         "nodeId" NUMBER NOT NULL,
         "xml" CLOB NOT NULL,
         CONSTRAINT "cmsContentXml_PK" PRIMARY KEY ( "nodeId" ) ENABLE
      ) ;
/
/* ****************************************************************************************************/      
/* cmsDataType ****************************************************************************************/      
CREATE TABLE "cmsDataType"
      (
         "pk"        NUMBER NOT NULL              ,
         "nodeId"    NUMBER NOT NULL              ,
         "controlId" VARCHAR2 ( 36 CHAR ) NOT NULL,
         "dbType"    VARCHAR2 ( 50 CHAR ) NOT NULL,
         CONSTRAINT "cmsDataType_PK" PRIMARY KEY ( "pk" ) ENABLE
      );
/
CREATE SEQUENCE "cmsDataType_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsDataType_TRG" BEFORE
    INSERT ON "cmsDataType" FOR EACH ROW BEGIN
    SELECT "cmsDataType_SEQ".NEXTVAL INTO :NEW."pk" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsDataTypePreValues *******************************************************************************/ 
CREATE TABLE "cmsDataTypePreValues"
      (
         "id"             NUMBER NOT NULL            ,
         "datatypeNodeId" NUMBER NOT NULL            ,
         "value"          VARCHAR2 ( 2500 CHAR ) NULL,
         "sortorder"      NUMBER NOT NULL            ,
         "alias"          VARCHAR2 ( 50 CHAR ) NULL       ,
         CONSTRAINT "cmsDataTypePreValues_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsDataTypePreValues_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsDataTypePreValues_TRG" BEFORE
    INSERT ON "cmsDataTypePreValues" FOR EACH ROW BEGIN
    SELECT "cmsDataTypePreValues_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsDictionary **************************************************************************************/ 
CREATE TABLE "cmsDictionary"
      (
         "pk"     NUMBER NOT NULL                ,
         "id"     VARCHAR2 ( 36 CHAR ) NOT NULL  ,
         "parent" VARCHAR2 ( 36 CHAR ) NOT NULL  ,
         "key"    VARCHAR2 ( 1000 CHAR ) NOT NULL,
         CONSTRAINT "cmsDictionary_PK" PRIMARY KEY ( "pk" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsDictionary_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsDictionary_TRG" BEFORE
    INSERT ON "cmsDictionary" FOR EACH ROW BEGIN
    SELECT "cmsDictionary_SEQ".NEXTVAL INTO :NEW."pk" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsLanguageText ************************************************************************************/
CREATE TABLE "cmsLanguageText"
      (
         "pk"         NUMBER NOT NULL                           ,
         "languageId" NUMBER NOT NULL                           ,
         "UniqueId"   VARCHAR2 ( 36 CHAR ) NOT NULL             ,
         "value"      VARCHAR2 ( 1000 CHAR ) NOT NULL           ,
         CONSTRAINT "cmsLanguageText_PK" PRIMARY KEY ( "pk" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsLanguageText_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsLanguageText_TRG" BEFORE
    INSERT ON "cmsLanguageText" FOR EACH ROW BEGIN
    SELECT "cmsLanguageText_SEQ".NEXTVAL INTO :NEW."pk" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsMember2MemberGroup ******************************************************************************/
CREATE TABLE "cmsMember2MemberGroup"
      (
         "Member"      NUMBER NOT NULL,
         "MemberGroup" NUMBER NOT NULL
      ) ;
/
ALTER TABLE "cmsMember2MemberGroup" ADD CONSTRAINT "PK_cmsMember2MemberGroup" PRIMARY KEY
			(
			   "Member", "MemberGroup"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* cmsStylesheetProperty ******************************************************************************/
CREATE TABLE "cmsStylesheetProperty"
      (
         "nodeId"                   NUMBER NOT NULL     ,
         "stylesheetPropertyEditor" NUMBER ( 1, 0 )     ,
         "stylesheetPropertyAlias"  VARCHAR2 ( 50 CHAR ),
         "stylesheetPropertyValue"  VARCHAR2 ( 400 CHAR )
      ) ;
/
/* ****************************************************************************************************/
/* umbracoDomains *************************************************************************************/
CREATE TABLE "umbracoDomains"
      (
         "id"                    NUMBER NOT NULL               ,
         "domainDefaultLanguage" NUMBER                        ,
         "domainRootStructureID" NUMBER                        ,
         "domainName"            VARCHAR2 ( 255 CHAR ) NOT NULL,
         CONSTRAINT "umbracoDomains_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoDomains_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoDomains_TRG" BEFORE
    INSERT ON "umbracoDomains" FOR EACH ROW BEGIN
    SELECT "umbracoDomains_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoLanguage ************************************************************************************/
CREATE TABLE "umbracoLanguage"
      (
         "id"                  NUMBER NOT NULL											,
         "languageISOCode" VARCHAR2 ( 10 CHAR )											,
         "languageCultureName" VARCHAR2 ( 100 CHAR )                ,
         CONSTRAINT "umbracoLanguage_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoLanguage_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoLanguage_TRG" BEFORE
    INSERT ON "umbracoLanguage" FOR EACH ROW BEGIN
    SELECT "umbracoLanguage_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoRelationType ********************************************************************************/
CREATE TABLE "umbracoRelationType"
      (
         "id"               NUMBER NOT NULL               ,
         "dual"             NUMBER ( 1, 0 ) NOT NULL      ,
         "parentObjectType" VARCHAR2 ( 36 CHAR ) NOT NULL ,
         "childObjectType"  VARCHAR2 ( 36 CHAR ) NOT NULL ,
         "name"             VARCHAR2 ( 255 CHAR ) NOT NULL,
         "alias"            VARCHAR2 ( 100 CHAR )         ,
         CONSTRAINT "umbracoRelationType_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "umbracoRelationType_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "umbracoRelationType_TRG" BEFORE
    INSERT ON "umbracoRelationType" FOR EACH ROW BEGIN
    SELECT "umbracoRelationType_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* umbracoStatEntry ***********************************************************************************/
CREATE TABLE "umbracoStatEntry"
      (
         "SessionId" NUMBER NOT NULL,
         "EntryTime" DATE NOT NULL  ,
         "RefNodeId" NUMBER NOT NULL,
         "NodeId"    NUMBER NOT NULL
      ) ;
/
ALTER TABLE "umbracoStatEntry" ADD CONSTRAINT "PK_umbracoStatEntry" PRIMARY KEY
			(
			   "SessionId", "EntryTime", "RefNodeId", "NodeId"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* umbracoUser2NodeNotify *****************************************************************************/
CREATE TABLE "umbracoUser2NodeNotify"
      (
         "userId" NUMBER NOT NULL,
         "nodeId" NUMBER NOT NULL,
         "action" VARCHAR2 ( 1 CHAR ) NOT NULL
      ) ;
/
ALTER TABLE "umbracoUser2NodeNotify" ADD CONSTRAINT "PK_umbracoUser2NodeNotify" PRIMARY KEY
			(
			   "userId", "nodeId", "action"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* umbracoUser2NodePermission *************************************************************************/
 CREATE TABLE "umbracoUser2NodePermission"
      (
         "userId"     NUMBER NOT NULL,
         "nodeId"     NUMBER NOT NULL,
         "permission" VARCHAR2 ( 1 CHAR ) NOT NULL
      ) ;
/
ALTER TABLE "umbracoUser2NodePermission" ADD CONSTRAINT "PK_umbracoUser2NodePermission" PRIMARY KEY
			(
			   "userId", "nodeId", "permission"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* umbracoUserLogins **********************************************************************************/
 CREATE TABLE "umbracoUserLogins"
      (
         "contextId" VARCHAR2 ( 36 CHAR ) NOT NULL,
         "userID"    NUMBER NOT NULL              ,
         "timeout"   NUMBER NOT NULL
      ) ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-92, 0, -1, 0, 11, '-1,-92', 37, 'f0bc4bfb-b499-40d6-ba86-058885a5178c', 'Label', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 	
	(-90, 0, -1, 0, 11, '-1,-90', 35, '84c6b441-31df-4ffe-b67e-67d5bc3ae65a', 'Upload', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-89, 0, -1, 0, 11, '-1,-89', 34, 'c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3', 'Textbox multiple', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-88, 0, -1, 0, 11, '-1,-88', 33, '0cc0eba1-9960-42c9-bf9b-60e150b429ae', 'Textstring', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-87, 0, -1, 0, 11, '-1,-87', 32, 'ca90c950-0aff-4e72-b976-a30b1ac57dad', 'Richtext editor', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-51, 0, -1, 0, 11, '-1,-51', 4, '2e6d3631-066e-44b8-aec4-96f09099b2b5', 'Numeric', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-49, 0, -1, 0, 11, '-1,-49', 2, '92897bc6-a5f3-4ffe-ae27-f2e7e33dda49', 'True/false', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-43, 0, -1, 0, 1, '-1,-43', 2, 'fbaf13a8-4036-41f2-93a3-974f678c312a', 'Checkbox list', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:11:04.367','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-42, 0, -1, 0, 1, '-1,-42', 2, '0b6a45e7-44ba-430d-9da5-4e46060b9e03', 'Dropdow', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:10:59.000','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-41, 0, -1, 0, 1, '-1,-41', 2, '5046194e-4237-453c-a547-15db3a07c4e1', 'Date Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:10:54.303','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-40, 0, -1, 0, 1, '-1,-40', 2, 'bb5f57c9-ce2b-4bb9-b697-4caca783a805', 'Radiobox', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:10:49.253','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-39, 0, -1, 0, 1, '-1,-39', 2, 'f38f0ac7-1d27-439c-9f3f-089cd8825a53', 'Dropdown multiple', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:10:44.480','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-38, 0, -1, 0, 1, '-1,-38', 2, 'fd9f1447-6c61-4a7c-9595-5aa39147d318', 'Folder Browser', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:10:37.020','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-37, 0, -1, 0, 1, '-1,-37', 2, '0225af17-b302-49cb-9176-b9f35cab9c17', 'Approved Color', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:10:30.580','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-36, 0, -1, 0, 1, '-1,-36', 2, 'e4d66c0f-b935-4200-81f0-025f7256b89a', 'Date Picker with time', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2004/10/15 14:10:23.007','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-20, 0, -1, 0, 0, '-1,-20', 0, '0F582A79-1E41-4CF0-BFA0-76340651891A', 'Recycle Bin', '01BB7FF2-24DC-4C0C-95A2-C24EF72BBAC8', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(-1, 0, -1, 0, 0, '-1', 0, '916724a5-173d-4619-b97e-b9de133dd6f5', 'SYSTEM DATA: umbraco master root', 'ea7d8624-4cfe-4578-a871-24aa946bf34d', TO_TIMESTAMP('2004/09/30 14:01:49.920','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1031, 0, -1, 1, 1, '-1,1031', 2, 'f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d', 'Folder', '4ea4382b-2f5a-4c2b-9587-ae9b3cf3602e', TO_TIMESTAMP('2004/12/01 00:13:40.743','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1032, 0, -1, 1, 1, '-1,1032', 2, 'cc07b313-0843-4aa8-bbda-871c8da728c8', 'Image', '4ea4382b-2f5a-4c2b-9587-ae9b3cf3602e', TO_TIMESTAMP('2004/12/01 00:13:43.737','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1033, 0, -1, 1, 1, '-1,1033', 2, '4c52d8ab-54e6-40cd-999c-7a5f24903e4d', 'File', '4ea4382b-2f5a-4c2b-9587-ae9b3cf3602e', TO_TIMESTAMP('2004/12/01 00:13:46.210','YYYY/MM/DD HH24:MI:SS.FF'));
/	
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1034, 0, -1, 0, 1, '-1,1034', 2, 'a6857c73-d6e9-480c-b6e6-f15f6ad11125', 'Content Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2006/01/03 13:07:29.203','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1035, 0, -1, 0, 1, '-1,1035', 2, '93929b9a-93a2-4e2a-b239-d99334440a59', 'Media Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2006/01/03 13:07:36.143','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1036, 0, -1, 0, 1, '-1,1036', 2, '2b24165f-9782-4aa3-b459-1de4a4d21f60', 'Member Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2006/01/03 13:07:40.260','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1037, 0, -1, 0, 1, '-1,1037', 2, 'b23b8044-1017-4187-8bc6-2153a0c7713d', 'Mass Mailer', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2006/01/03 13:07:50.023','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1038, 0, -1, 0, 1, '-1,1038', 2, '1251c96c-185c-4e9b-93f4-b48205573cbd', 'Simple Editor', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2006/01/03 13:07:55.250','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1039, 0, -1, 0, 1, '-1,1039', 2, '06f349a9-c949-4b6a-8660-59c10451af42', 'Ultimate Picker', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2006/01/03 13:07:55.250','YYYY/MM/DD HH24:MI:SS.FF'));
/
INSERT INTO "umbracoNode" ("id", "trashed", "parentID", "nodeUser", "level", "path", "sortOrder", "uniqueID", "text", "nodeObjectType", "createDate") VALUES 
	(1040, 0, -1, 0, 1, '-1,1040', 2, '21e798da-e06e-4eda-a511-ed257f78d4fa', 'Related Links', '30a2a501-1978-4ddb-a57b-f7efed43ba3c', TO_TIMESTAMP('2006/01/03 13:07:55.250','YYYY/MM/DD HH24:MI:SS.FF'));
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "cmsContentType" ( "pk", "NodeId", "alias", "icon" ) VALUES
	( 532, 1031, 'Folder', 'folder.gif' )   ;
/
INSERT INTO "cmsContentType" ( "pk", "NodeId", "alias", "icon" ) VALUES
	( 533, 1032, 'Image', 'mediaPhoto.gif' );
/
INSERT INTO "cmsContentType" ( "pk", "NodeId", "alias", "icon" ) VALUES
	( 534, 1033, 'File', 'mediaMulti.gif' ) ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/

INSERT INTO "umbracoUserType" ("id", "userTypeAlias", "userTypeName", "userTypeDefaultPermissions") VALUES
	(1, 'admin', 'Administrators', 'CADMOSKTPIURZ5:');
/
INSERT INTO "umbracoUserType" ("id", "userTypeAlias", "userTypeName", "userTypeDefaultPermissions") VALUES
	(2, 'writer', 'Writer', 'CAH:')                  ;
/
INSERT INTO "umbracoUserType" ("id", "userTypeAlias", "userTypeName", "userTypeDefaultPermissions") VALUES
	(3, 'editor', 'Editors', 'CADMOSKTPUZ5:')        ;
/
INSERT INTO "umbracoUserType" ("id", "userTypeAlias", "userTypeName", "userTypeDefaultPermissions") VALUES
	(4, 'translator', 'Translator', 'A') ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoUser" ("id", "userDisabled", "userNoConsole", "userType", "startStructureID", "startMediaID", "userName", "userLogin", "userPassword", "userEmail", "userDefaultPermissions", "userLanguage") VALUES 
  (0, 0, 0, 1, -1, -1, 'Administrator', 'admin', 'default', ' ', NULL, 'en') ;
/ 
/* ****************************************************************************************************/
/* ****************************************************************************************************/
UPDATE "umbracoUser" SET "id"=0 WHERE "id"=1 AND "userLogin"='admin';
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoApp" ( "appAlias", "sortOrder", "appIcon", "appName", "appInitWithTreeAlias" ) VALUES
	( 'content', 0, '.traycontent', 'Indhold', 'content' )   ;
/
INSERT INTO "umbracoApp" ( "appAlias", "sortOrder", "appIcon", "appName", "appInitWithTreeAlias" ) VALUES
	( 'developer', 7, '.traydeveloper', 'Developer', NULL )  ;
/
INSERT INTO "umbracoApp" ( "appAlias", "sortOrder", "appIcon", "appName", "appInitWithTreeAlias" ) VALUES
	( 'media', 1, '.traymedia', 'Mediearkiv', NULL )         ;
/
INSERT INTO "umbracoApp" ( "appAlias", "sortOrder", "appIcon", "appName", "appInitWithTreeAlias" ) VALUES
	( 'member', 8, '.traymember', 'Medlemmer', NULL )        ;
/
INSERT INTO "umbracoApp" ( "appAlias", "sortOrder", "appIcon", "appName", "appInitWithTreeAlias" ) VALUES
	( 'settings', 6, '.traysettings', 'Indstillinger', NULL );
/
INSERT INTO "umbracoApp" ( "appAlias", "sortOrder", "appIcon", "appName", "appInitWithTreeAlias" ) VALUES
	( 'users', 5, '.trayusers', 'Brugere', NULL ) ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoUser2app" ("user", "app") VALUES
	(0, 'content')  ;
/
INSERT INTO "umbracoUser2app" ("user", "app") VALUES
	(0, 'developer');
/
INSERT INTO "umbracoUser2app" ("user", "app") VALUES
	(0, 'media')    ;
/
INSERT INTO "umbracoUser2app" ("user", "app") VALUES
	(0, 'member')   ;
/
INSERT INTO "umbracoUser2app" ("user", "app") VALUES
	(0, 'settings') ;
/
INSERT INTO "umbracoUser2app" ("user", "app") VALUES
	(0, 'users') ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('content', 'content', 1, 1, 0, 'Indhold', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadContent')											;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('developer', 'cacheBrowser', 0, 1, 0, 'CacheBrowser', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadCache')						;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('developer', 'CacheItem', 0, 0, 0, 'Cachebrowser', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadCacheItem')						;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('developer', 'datatype', 0, 1, 1, 'Datatyper', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadDataTypes')								;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('developer', 'macros', 0, 1, 2, 'Macros', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadMacros')												;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('developer', 'xslt', 0, 1, 5, 'XSLT Files', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadXslt')												;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES	
	('developer', 'packager', 0, 1, 3, 'Packages', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadPackager')									;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('developer', 'packagerPackages', 0, 0, 1, 'Packager Packages', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadPackages');
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('media', 'media', 0, 1, 0, 'Medier', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadMedia')															;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('member', 'member', 0, 1, 0, 'Medlemmer', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadMembers')											;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('member', 'memberGroup', 0, 1, 1, 'MemberGroups', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadMemberGroups')					;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('member', 'memberType', 0, 1, 2, 'Medlemstyper', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadMemberTypes')						;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('settings', 'languages', 0, 1, 4, 'Languages', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadLanguages')								;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('settings', 'mediaTypes', 0, 1, 5, 'Medietyper', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadMediaTypes')						;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('settings', 'nodeTypes', 0, 1, 6, 'Dokumenttyper', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadNodeTypes')						;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('settings', 'stylesheetProperty', 0, 0, 0, 'Stylesheet Property', ' ', ' ', 'umbraco', 'loadStylesheetProperty')					;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('settings', 'stylesheets', 0, 1, 0, 'Stylesheets', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadStylesheets')					;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('settings', 'templates', 0, 1, 1, 'Templates', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadTemplates')								;
/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType") VALUES
	('users', 'users', 0, 1, 0, 'Brugere', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadUsers') 														;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoAppTree" ("appAlias", "treeAlias", "treeSilent", "treeInitialize", "treeSortOrder", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType", "action") VALUES
	('settings', 'dictionary', 0, 1, 3, 'Dictionary', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadDictionary','openDictionary()') ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(3, 'mediaCurrent', 'umbraco.macroRenderings', 'media', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(4, 'contentSubs', 'umbraco.macroRenderings', 'content', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(5, 'contentRandom', 'umbraco.macroRenderings', 'content', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(6, 'contentPicker', 'umbraco.macroRenderings', 'content', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(13, 'number', 'umbraco.macroRenderings', 'numeric', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(14, 'bool', 'umbraco.macroRenderings', 'yesNo', 'Boolea');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(16, 'text', 'umbraco.macroRenderings', 'text', 'String');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(17, 'contentTree', 'umbraco.macroRenderings', 'content', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(18, 'contentType', 'umbraco.macroRenderings', 'contentTypeSingle', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(19, 'contentTypeMultiple', 'umbraco.macroRenderings', 'contentTypeMultiple', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(20, 'contentAll', 'umbraco.macroRenderings', 'content', 'Int32');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(21, 'tabPicker', 'umbraco.macroRenderings', 'tabPicker', 'String');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(22, 'tabPickerMultiple', 'umbraco.macroRenderings', 'tabPickerMultiple', 'String');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES
	(23, 'propertyTypePicker', 'umbraco.macroRenderings', 'propertyTypePicker', 'String');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES	
	(24, 'propertyTypePickerMultiple', 'umbraco.macroRenderings', 'propertyTypePickerMultiple', 'String');
/
INSERT INTO "cmsMacroPropertyType" ("id", "macroPropertyTypeAlias", "macroPropertyTypeRendAssembly", "macroPropertyTypeRenderType", "macroPropertyTypeBaseType") VALUES	
	(25, 'textMultiLine', 'umbraco.macroRenderings', 'textMultiple', 'String') ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "cmsTab" ("id", "contenttypeNodeId", "text", "sortorder") VALUES
	(3, 1032, 'Image', 1);
/
INSERT INTO "cmsTab" ("id", "contenttypeNodeId", "text", "sortorder") VALUES
	(4, 1033, 'File', 1);
/
INSERT INTO "cmsTab" ("id", "contenttypeNodeId", "text", "sortorder") VALUES
	(5, 1031, 'Contents', 1);
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(6, -90, 1032, 3, 'umbracoFile', 'Upload image', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(7, -92, 1032, 3, 'umbracoWidth', 'Width', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(8, -92, 1032, 3, 'umbracoHeight', 'Height', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(9, -92, 1032, 3, 'umbracoBytes', 'Size', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(10, -92, 1032, 3, 'umbracoExtensio', 'Type', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(24, -90, 1033, 4, 'umbracoFile', 'Upload file', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(25, -92, 1033, 4, 'umbracoExtensio', 'Type', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(26, -92, 1033, 4, 'umbracoBytes', 'Size', NULL, 0, 0, NULL, NULL);
/
INSERT INTO "cmsPropertyType" ("id", "dataTypeId", "contentTypeId", "tabId", "Alias", "Name", "helpText", "sortOrder", "mandatory", "validationRegExp", "Description") VALUES
	(27, -38, 1031, 5, 'contents', 'Contents:', NULL, 0, 0, NULL, NULL);
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoLanguage" ("id", "languageISOCode", "languageCultureName") VALUES (1, 'en-US', 'en-US');
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "cmsContTypeAllowedContType" ("Id", "AllowedId") VALUES (1031, 1031);
/
INSERT INTO "cmsContTypeAllowedContType" ("Id", "AllowedId") VALUES (1031, 1032);
/
INSERT INTO "cmsContTypeAllowedContType" ("Id", "AllowedId") VALUES (1031, 1033);
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(4, -49, '38b352c1-e9f8-4fd8-9324-9a2eab06d97a', 'Integer');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(6, -51, '1413afcb-d19a-4173-8e9a-68288d2a73b8', 'Integer');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(8, -87, '5E9B75AE-FACE-41c8-B47E-5F4B0FD82F83', 'Ntext');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(9, -88, 'ec15c1e5-9d90-422a-aa52-4f7622c63bea', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(10, -89, '67db8357-ef57-493e-91ac-936d305e0f2a', 'Ntext');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(11, -90, '5032a6e6-69e3-491d-bb28-cd31cd11086c', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(12, -91, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(13, -92, '6c738306-4c17-4d88-b9bd-6546f3771597', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(14, -36, 'b6fb1622-afa5-4bbf-a3cc-d9672a442222', 'Date');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(15, -37, 'f8d60f68-ec59-4974-b43b-c46eb5677985', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(16, -38, 'cccd4ae9-f399-4ed2-8038-2e88d19e810c', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(17, -39, '928639ed-9c73-4028-920c-1e55dbb68783', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(18, -40, 'a52c7c1c-c330-476e-8605-d63d3b84b6a6', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(19, -41, '23e93522-3200-44e2-9f29-e61a6fcbb79a', 'Date');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(20, -42, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Integer');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(21, -43, 'b4471851-82b6-4c75-afa4-39fa9c6a75e9', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
  (22, -44, 'a3776494-0574-4d93-b7de-efdfdec6f2d1', 'Ntext');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(23, -128, 'a52c7c1c-c330-476e-8605-d63d3b84b6a6', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(24, -129, '928639ed-9c73-4028-920c-1e55dbb68783', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(25, -130, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(26, -131, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(27, -132, 'a74ea9c9-8e18-4d2a-8cf6-73c6206c5da6', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(28, -133, '6c738306-4c17-4d88-b9bd-6546f3771597', 'Ntext');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(29, -134, '928639ed-9c73-4028-920c-1e55dbb68783', 'Nvarchar');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(30, -50, 'aaf99bb2-dbbe-444d-a296-185076bf0484', 'Date');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(31, 1034, '158aa029-24ed-4948-939e-c3da209e5fba', 'Integer');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(32, 1035, 'ead69342-f06d-4253-83ac-28000225583b', 'Integer');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(33, 1036, '39f533e4-0551-4505-a64b-e0425c5ce775', 'Integer');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(34, 1037, 'aabe748c-efb6-4225-b7b2-dabc6fe36945', 'Ntext');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(35, 1038, '60b7dabf-99cd-41eb-b8e9-4d2e669bbde9', 'Ntext');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(36, 1039, 'cdbf0b5d-5cb2-445f-bc12-fcaaec07cf2c', 'Ntext');
/
INSERT INTO "cmsDataType" ("pk", "nodeId", "controlId", "dbType") VALUES
	(37, 1040, '71b8ad1a-8dc2-425c-b6b8-faa158075e63', 'Ntext');
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
ALTER TABLE "umbracoAppTree" ADD CONSTRAINT "umbracoAppTree_umbracoApp_FK" FOREIGN KEY ( "appAlias" ) REFERENCES "umbracoApp" ( "appAlias" ) ENABLE ;
/
ALTER TABLE "cmsPropertyData" ADD CONSTRAINT "cmsPropertyData_umbracoNode_FK" FOREIGN KEY ("contentNodeId") REFERENCES "umbracoNode" ("id")  ENABLE ;
/
ALTER TABLE "umbracoUser2userGroup" ADD CONSTRAINT "User2userGroup_umbracoUser_FK" FOREIGN KEY ("user") REFERENCES "umbracoUser" ("id") ENABLE;
/
ALTER TABLE "umbracoUser2userGroup" ADD CONSTRAINT "User2userGroup_UserGroup_FK" FOREIGN KEY ("userGroup") REFERENCES "umbracoUserGroup" ("id") ENABLE;
/
ALTER TABLE "cmsDocument" ADD CONSTRAINT "cmsDocument_umbracoNode_FK" FOREIGN KEY ("nodeId") REFERENCES "umbracoNode" ("id") ENABLE;
/
ALTER TABLE "cmsMacroProperty" ADD CONSTRAINT "MacroProp_MacroPropType_FK" FOREIGN KEY ("macroPropertyType") REFERENCES "cmsMacroPropertyType" ("id") ENABLE;
/
ALTER TABLE "umbracoUser" ADD CONSTRAINT "umbracoUser_umbracoUserType_FK" FOREIGN KEY ("userType") REFERENCES "umbracoUserType" ("id") ENABLE; 
/
ALTER TABLE "cmsTemplate" ADD CONSTRAINT "cmsTemplate_umbracoUserType_FK" FOREIGN KEY ("nodeId") REFERENCES "umbracoNode" ("id") ENABLE;
/
ALTER TABLE "cmsContent" ADD CONSTRAINT "cmsContent_umbracoNode_FK" FOREIGN KEY ("nodeId") REFERENCES "umbracoNode" ("id") ENABLE;
/
ALTER TABLE "umbracoUser2app" ADD CONSTRAINT "umbracoUser2app_umbracoApp_FK" FOREIGN KEY ("app") REFERENCES "umbracoApp" ("appAlias") ENABLE;
/
ALTER TABLE "cmsContentType" ADD CONSTRAINT "cmsContentType_umbracoNode_FK" FOREIGN KEY ("NodeId") REFERENCES "umbracoNode" ("id") ENABLE;
/
ALTER TABLE "cmsPropertyType" ADD CONSTRAINT "cmsPropertyType_cmsTab_FK" FOREIGN KEY ("tabId") REFERENCES "cmsTab" ("id") ENABLE;
/
ALTER TABLE "umbracoNode" ADD CONSTRAINT "umbracoNode_umbracoNode_FK" FOREIGN KEY ("parentID") REFERENCES "umbracoNode" ("id") ENABLE;
/

/* ****************************************************************************************************/
/* cmsTask ********************************************************************************************/
CREATE TABLE "cmsTask"
      (
         "closed"       NUMBER ( 1, 0 ) DEFAULT 0 NOT NULL,
         "id"           NUMBER NOT NULL                   ,
         "taskTypeId"   NUMBER NOT NULL                   ,
         "nodeId"       NUMBER NOT NULL                   ,
         "parentUserId" NUMBER NOT NULL                   ,
         "userId"       NUMBER NOT NULL                   ,
         "DateTime" TIMESTAMP DEFAULT SYSDATE             ,
         "Comment" VARCHAR2 ( 500 CHAR )                  ,
         CONSTRAINT "cmsTaske_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsTask_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsTask_TRG" BEFORE
    INSERT ON "cmsTask" FOR EACH ROW BEGIN
    SELECT "cmsTask_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* cmsTaskType ****************************************************************************************/
CREATE TABLE "cmsTaskType"
      (
         "id"    NUMBER NOT NULL 													 ,
         "alias" VARCHAR2 ( 255 CHAR ) NOT NULL            ,
         CONSTRAINT "cmsTaskType_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
/
CREATE SEQUENCE "cmsTaskType_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsTaskType_TRG" BEFORE
    INSERT ON "cmsTaskType" FOR EACH ROW BEGIN
    SELECT "cmsTaskType_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "cmsTaskType" ("alias") VALUES ( 'toTranslate' ) ;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoRelationType" ("dual", "parentObjectType", "childObjectType", "name", "alias") 
VALUES (1, 'c66ba18e-eaf3-4cff-8a22-41b16d66a972', 'c66ba18e-eaf3-4cff-8a22-41b16d66a972', 'Relate Document On Copy','relateDocumentOnCopy');
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
ALTER TABLE "cmsMacro" ADD ("macroPython" VARCHAR2(255 CHAR));
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
INSERT INTO "umbracoAppTree"("treeSilent", "treeInitialize", "treeSortOrder", "appAlias", "treeAlias", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType")
VALUES(0, 1, 4, 'developer', 'python', 'Python Files', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadPython');
/
INSERT INTO "umbracoAppTree"("treeSilent", "treeInitialize", "treeSortOrder", "appAlias", "treeAlias", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType")
VALUES(0, 1, 2, 'settings', 'scripts', 'Scripts', 'folder.gif', 'folder_o.gif', 'umbraco', 'loadScripts');
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
ALTER TABLE "cmsContentType" ADD  ("macroPython" VARCHAR2(255 CHAR) DEFAULT 'folder.png' NOT NULL);
/
ALTER TABLE "cmsContentType" ADD  ("description" VARCHAR2(1500 CHAR));
/
ALTER TABLE "cmsContentType" ADD  ("masterContentType" NUMBER);
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
UPDATE  "umbracoUserType" SET "userTypeDefaultPermissions" = CONCAT("userTypeDefaultPermissions", 'F')
  WHERE INSTR("userTypeDefaultPermissions",'A') >= 1
		AND INSTR("userTypeDefaultPermissions",'F') < 1;
/
UPDATE  "umbracoUserType" SET "userTypeDefaultPermissions" = CONCAT("userTypeDefaultPermissions", 'H')
  WHERE "userTypeAlias" = 'writer'
	  AND INSTR("userTypeDefaultPermissions",'F') < 1;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
BEGIN
	INSERT INTO "umbracoUser2NodePermission" ("userId", "nodeId", "permission") 
	SELECT "userId", "nodeId", 'F' FROM "umbracoUser2NodePermission" WHERE "permission"='A';
	
	INSERT INTO "umbracoUser2NodePermission" ("userId", "nodeId", "permission") 
	SELECT DISTINCT "userId", "nodeId", 'H' FROM "umbracoUser2NodePermission" WHERE "userId" IN
	(SELECT "umbracoUser"."id" FROM "umbracoUserType" INNER JOIN "umbracoUser" ON "umbracoUserType"."id" = "umbracoUser"."userType" WHERE ("umbracoUserType"."userTypeAlias" = 'writer'));
	
	INSERT INTO "umbracoAppTree" ("treeSilent", "treeInitialize", "treeSortOrder", "appAlias", "treeAlias", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType")
	VALUES (0, 0, 0, 'content', 'contentRecycleBin', 'RecycleBin', 'folder.gif', 'folder_o.gif', 'umbraco', 'cms.presentation.Trees.ContentRecycleBin');

	INSERT INTO "umbracoAppTree" ("treeSilent", "treeInitialize", "treeSortOrder", "appAlias", "treeAlias", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType")
	VALUES (0, 1, 1, 'users', 'userTypes', 'User Types', 'folder.gif', 'folder_o.gif', 'umbraco', 'cms.presentation.Trees.UserTypes');

	INSERT INTO "umbracoAppTree" ("treeSilent", "treeInitialize", "treeSortOrder", "appAlias", "treeAlias", "treeTitle", "treeIconClosed", "treeIconOpen", "treeHandlerAssembly", "treeHandlerType")
	VALUES (0, 1, 2, 'users', 'userPermissions', 'User Permissions', 'folder.gif', 'folder_o.gif', 'umbraco', 'cms.presentation.Trees.UserPermissions');
	EXCEPTION WHEN OTHERS
  THEN
			NULL;
END;
/
/* ****************************************************************************************************/
/* cmsTagRelationship *********************************************************************************/
 CREATE TABLE "cmsTagRelationship"
      (
         "nodeId" NUMBER NOT NULL,
         "tagId"  NUMBER NOT NULL
      ) ;
/
ALTER TABLE "cmsTagRelationship" ADD CONSTRAINT "PK_cmsTagRelationship" PRIMARY KEY
			(
			   "nodeId", "tagId"
			)
			ENABLE ;
/
/* ****************************************************************************************************/
/* cmsTags ********************************************************************************************/
 CREATE TABLE "cmsTags"
      (
         "id"       NUMBER NOT NULL      ,
         "tag"      VARCHAR2 ( 200 CHAR ),
         "parentId" NUMBER               ,
         "group"    VARCHAR2 ( 100 CHAR ),
         CONSTRAINT "cmsTags_PK" PRIMARY KEY ( "id" ) ENABLE
      ) ;
CREATE SEQUENCE "cmsTags_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1
   START WITH 1 CACHE 20 NOORDER NOCYCLE ;
/
CREATE OR REPLACE TRIGGER "cmsTags_TRG" BEFORE
    INSERT ON "cmsTags" FOR EACH ROW BEGIN
    SELECT "cmsTags_SEQ".NEXTVAL INTO :NEW."id" FROM DUAL;
END;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/
ALTER TABLE "cmsTagRelationship" ADD CONSTRAINT "Node_cmsTagRelationship_FK" FOREIGN KEY ( "nodeId" ) REFERENCES "umbracoNode" ("id") ON DELETE CASCADE;
/
ALTER TABLE "cmsTagRelationship" ADD CONSTRAINT "cmsTags_cmsTagRelationship_FK" FOREIGN KEY ( "tagId" ) REFERENCES "cmsTags" ("id") ON DELETE CASCADE;
/
/* ****************************************************************************************************/
/* ****************************************************************************************************/